Skip to content

chore(logger): clear prev request buffers in manual mode #3742

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 19, 2025

Conversation

dreamorosi
Copy link
Contributor

Summary

Changes

Please provide a summary of what's being changed

The PR updates the default behavior of the log buffering feature in the Logger utility to clear existing buffers whenever creating the buffer for a new request. This was already the case when using the class method decorator and the Middy.js middleware.

This PR aligns the behavior also for manual mode, aka when customers are not using either of the two patterns above. This will help reduce the likelihood that customers forget to clear log buffers and risk exhausting the memory available in the sandbox.

The PR also adds an additional item to the feature FAQs to document how the Logger calculates the size of each log entry. This should address questions from customers on the topic, which came in from early adopters.

Please add the issue number below, if no issue is present the PR might get blocked and not be reviewed

Issue number: closes #3705


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.

@dreamorosi dreamorosi self-assigned this Mar 19, 2025
@boring-cyborg boring-cyborg bot added documentation Improvements or additions to documentation logger This item relates to the Logger Utility labels Mar 19, 2025
@pull-request-size pull-request-size bot added the size/S PR between 10-29 LOC label Mar 19, 2025
@dreamorosi dreamorosi changed the title chore(logger): clear prev request buffers chore(logger): clear prev request buffers in manual mode Mar 19, 2025
@dreamorosi
Copy link
Contributor Author

E2e tests for this branch are green: https://github.com/aws-powertools/powertools-lambda-typescript/actions/runs/13947131658


I'm requesting both @am29d and @leandrodamascena review on this one on purpose, thank you.

@dreamorosi dreamorosi marked this pull request as ready for review March 19, 2025 13:53
@am29d am29d merged commit d13f3c6 into main Mar 19, 2025
41 checks passed
@am29d am29d deleted the fix/logger_buffering_default branch March 19, 2025 13:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation logger This item relates to the Logger Utility size/S PR between 10-29 LOC
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature request: Clear log buffer before starting next one
2 participants